Skip to content

Instantly share code, notes, and snippets.

@dweomer
dweomer / return-early-when-sourced.md
Last active July 15, 2026 20:22
scripting tricks

RETURN EARLY WHEN SOURCED

#!/usr/bin/env bash

# ===== Sourced Preamble =====================================
# This part runs whether the script is sourced OR executed.
# Perfect for setting aliases, exports, or functions.

my_shared_function() {
@tandpfun
tandpfun / SKILL.md
Created July 14, 2026 02:16
Extract Clothing Skill
name extract-clothing-cutouts
description Extract high-quality, deduplicated transparent ecommerce clothing cutouts from a folder of photographs where people wear one or more garments. Use when Codex must find outfit or model photos, identify unique clothing across images, create focused references, reconstruct complete garments with Imagegen, remove a solid chroma background into RGBA PNGs, and output only the finished clothing images into a new folder under the current working directory.

Extract Clothing Cutouts

Turn photographs of worn clothing into source-faithful standalone catalog PNGs. Treat each result as a reconstruction from visible evidence, not literal segmentation whenever the wearer or another layer occludes part of the garment.

Start by asking for two paths

@zainalfh
zainalfh / boot-repair.md
Created March 28, 2017 14:36
boot-repair is tool to repair boot grub on linux.

#install

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
@brenogazzola
brenogazzola / gist:0f8d2dc191e217d5ce6e9293fa34e640
Created July 15, 2026 20:03
Rails + PostgreSQL Performance Audit Playbook
# Rails + PostgreSQL Performance Audit Playbook
A field-tested method for finding what's actually burning your database CPU, built for a
Rails monolith on managed PostgreSQL (Cloud SQL / RDS / etc.). It assumes no APM — just
`pg_stat_statements`, `pg_stat_activity`, and discipline. It pairs well with an LLM: point
one at this file plus your query results and let it do the attribution; the queries below
are ordered so a human can run them and paste results back.
## The core idea
@guidocella
guidocella / dump-cookies.sh
Last active July 15, 2026 20:17
Convert qutebrowser's cookies to Netscape format
#!/bin/sh
{
echo '# Netscape HTTP Cookie File' # needed by youtube-dl
# There is no attempt to url encode $1, but SQLite already handles
# characters like spaces, so only ? % and # should cause issues.
sqlite3 -separator ' ' "file:${1:-$HOME/.local/share/qutebrowser}/webengine/Cookies?nolock=1" "
SELECT
host_key,
@cpuloader
cpuloader / README.md
Last active July 15, 2026 20:14 — forked from liamcottle/README.md
TNCAttach + RNode TNC = LoRa IP

TNCAttach + RNode TNC = LoRa IP

Orange Pi Zero device 2 <-> USB RNode TNC <-> LoRa 917.875MHz BW500kHz SF7 CR5 TXP17 <-> USB RNode TNC <-> Orange Pi Zero device 1 <-> WiFi 2.4GHz (Internet)

Install System Dependencies

sudo apt install build-essential
sudo apt install python3-pip
@drikusroor
drikusroor / create-sql-login-user.sql
Last active July 15, 2026 20:11
Create a SQL login, connect a user to it, and add roles to the user
-- Source: https://ainab.site/2021/12/08/create-an-azure-sql-server-login-and-connect-a-user-to-it/
-- Execute this query in the "master" database
-- Create new login
CREATE LOGIN [new-login]
WITH PASSWORD = 'complex-password'
GO
-- Execute these queries in the target database
name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output.

Explain Diff

Please make me a rich, interactive explanation of the specified code change.

It should have these sections: